package com.xundao.yxt.repository.impl;

import com.xundao.yxt.domain.model.User;
import com.xundao.yxt.domain.repository.UserRepository;
import com.xundao.yxt.repository.converter.UserConverter;
import com.xundao.yxt.repository.mapper.UserMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Repository;

@Slf4j
@Repository
@AllArgsConstructor
public class UserRepositoryImpl implements UserRepository {

    private final UserMapper userMapper;
    private final UserConverter userConverter;
    @Override
    public void updateLastLoginTime(User user) {
        if(user==null||user.getUserId()==null){
            return;
        }
        userMapper.updateById(userConverter.convert( user));
    }
}
